package cn.yunhe.video.dao;


import cn.yunhe.video.entity.UserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface IUserInfoMapper extends BaseMapper<UserInfo> {

    /**
     * 获取登录用户信息
     *
     * @return
     */
    @Select("select * from tb_userInfo where uid = #{uid}")
    UserInfo getUserInfoByName(UserInfo userInfo);

    @Update("update tb_userInfo set coin = coin - #{coin} where uid= #{uid}")
    int updateUserInfo(UserInfo userInfo);
}
